#include <string.h>
#include <stdio.h>
#include "FileSystem.h"
#include "stdlib.h"
#include "OpenFile.h"

using namespace std;

int main( int argc, char *argv[]) {
	string file = "/mega";
//STROET!
	FileSystem *fs = new FileSystem("/home/floppie");

	OpenFile* of = fs->open(file.c_str());

	cout << "Checking file: " << file << endl << endl;

	char buffer[512];
	int total = 0;
	int nread = 0;
	while ((nread = fs->read(of, buffer, 512)) > 0) {
		total += nread;
		//for (int i = 0; i < nread; ++i) {
		//	cout << buffer[i];
		//}

		cout << "hij heeft nu: " << total << " gelezen" << endl;
	}

	cout << endl << total << " characters read" << endl << endl << endl;

	of->toString();

	cout << endl << endl;

	fs->dumpTreeList();

	return 0;
}
